<template>
    <div>
        <el-dialog title="编辑" :visible.sync="dialogFormVisible1">
                        <el-form :model="form1">
                            <el-form-item label="名称" :label-width="formLabelWidth">
                                <el-input v-model="form1.name" autocomplete="off" disabled></el-input>
                            </el-form-item>
                            <el-form-item label="描述" :label-width="formLabelWidth">
                                <el-input v-model="form1.description" autocomplete="off"></el-input>
                            </el-form-item>
                            <el-form-item label="启用状态" :label-width="formLabelWidth">
                                <el-select v-model="form1.type" placeholder="请选择">
                                    <el-option label="启用" :value=true></el-option>
                                    <el-option label="停用" :value=false></el-option>
                                </el-select>
                            </el-form-item>
                        </el-form>

                        <div slot="footer" class="dialog-footer">
                            <el-button @click="dialogFormVisible1 = false">取 消</el-button>
                            <el-button type="primary" @click="edithandler">确 定</el-button>
                        </div>


                    </el-dialog>
    </div>
</template>
<script>
export default{
    data() {
        return {
            form1: {
                
            },
            dialogFormVisible1:false,
            formLabelWidth:''
        };
    },
    props: {
        requestUrl: {
            type: String,
            default: ''
        },
        currentTab: {
            type: String,
            default: ''
        }
    },
    methods:{
        show(v){
            this.dialogFormVisible1=true
            this.form1=v
        },
        edithandler(){
            this.dialogFormVisible1 = false

            this.$axios({
                url: `${this.requestUrl}${this.currentTab}/${this.form1.id}`,
                method: 'patch',
                data: this.form1
            })
            // this.render()
            this.$emit('addSuccess')
        }
    },
    // created(){
    //     this.form1=this.editData
    // }
}
</script>